﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>v2.0 upgrade guide </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="v2.0 upgrade guide ">
    <meta name="generator" content="docfx 2.40.12.0">
    
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    <meta property="docfx:rel" content="../">
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../images/logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items">
            <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
          </div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="v20-upgrade-guide">v2.0 upgrade guide</h1>

<p>This is the incomplete upgrade guide from v1.4 to v2.0. 
The most apparent changes will be mentioned here. If you notice 
important things missing then please post an issue.</p>
<h4 id="moved-from-pcl-to-net-standard-20">Moved from PCL to .NET Standard 2.0</h4>
<p>Look up compatible frameworks in <a href="https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support">this table</a>.</p>
<h4 id="viewport-moved-from-map-to-mapcontrol-and-is-readonly">Viewport moved from Map to MapControl and is readonly</h4>
<p>Use MapControl.Navigator instead.</p>
<h4 id="moved-mapcontrolnavigateto-methods-to-mapcontrolnavigator">Moved MapControl.NavigateTo methods to MapControl.Navigator</h4>
<p>All user map manipulation should go the the Navigator. </p>
<h4 id="introduced-maphome-to-initialze-the-map-viewport">Introduced Map.Home to initialze the map viewport</h4>
<p>There is now a Home delegate on the Map object that should be used to set
the initial state of the map. </p>
<pre><code class="lang-c#">MapControl.Map.Home = n =&gt; n.NavigateTo(myCenter, myResolution);
</code></pre><p><strong>Reason:</strong> This is because in some cases the Navigate
methods depend on the envelope and resolutions of the layers and in some
cases it takes time for these layers to load their data.</p>
<h4 id="added-mappanlock-mapzoomlock-and-maprotationlock">Added Map.PanLock, Map.ZoomLock and Map.RotationLock</h4>
<p>The lock fields can be used on all platforms to lock the user from 
a certain kind of map manipulation.</p>
<h4 id="added-maplimiter-to-limit-the-extent-to-which-the-user-can-navigate">Added Map.Limiter to limit the extent to which the user can navigate</h4>
<p>The Limter is an implementation of IViewportLimiter. There are currently
three limiters part of Mapsui: </p>
<ul>
<li>ViewportLimiter (default)</li>
<li>ViewportLimiterKeepWithin</li>
<li>ViewportLimiterWithoutLimits
It is also possible to implement your own IViewportLimiter.</li>
</ul>
<h4 id="added-refreshgraphics-refreshdata-and-refresh">Added RefreshGraphics, RefreshData and Refresh</h4>
<ul>
<li>Use RefreshGraphics if you know the data in the layer has changed and the graphics needs refreshing.</li>
<li>Use RefreshData if you know there is new data available in the source.</li>
<li>Use Refresh if you need to do both.
These methods should only be needed if you manipulate data somehow in your own code.</li>
</ul>
<h4 id="renamed-boundingbox-getcentroid-to-centroid-and-getboundingbox-to-boundingbox">Renamed BoundingBox GetCentroid to Centroid and GetBoundingBox to BoundingBox</h4>
<p>Turned these methods into proper properties making user code a bit more compact.</p>
<h4 id="the-info-event-was-moved-from-map-to-mapcontrol">The Info event was moved from Map to MapControl</h4>
<p>The MapControl contains most other events as well</p>
<h4 id="removed-the-infolayer-list-and-add-an-infolayer-boolean-on-ilayer">Removed the InfoLayer list and add an InfoLayer boolean on ILayer</h4>
<p>To indicate that a layer is a info layer you now need to set it&#39;s 
InfoLayer property. In v1.4 it had to be added to the list of InfoLayers.</p>
<h4 id="removed-the-hoverlayer-method">Removed the HoverLayer method.</h4>
<p>This is because hover could not be implemented crossplatform and could harm performance.
It it is still possible to implement hover yourself using a direct call to MapControl.GetMapInfo.</p>
<h4 id="invert-label-alignment-bottomtop">Invert label alignment bottom/top.</h4>
<p>This was incorrect in v1.4. This will not cause a compile error so don&#39;t forget
to do a search-replace to fix it.</p>
<h4 id="removed-zoominzoomout-from-wpf-mapcontrol">Removed ZoomIn/ZoomOut from WPF MapControl</h4>
<p>Use the ZoomIn/ZoomOut methode on the navigator.</p>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/Mapsui/Mapsui/blob/master/docfx/documentation/v2.0-upgrade-guide.md/#L1" class="contribution-link">Improve this Doc</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
